<html>
<head>
<title>Kipin Pro Options</title>
<script type="text/javascript" src="options.js"></script>
<style type="text/css">
body {
    background-color: #000000;
    color: #eeeeee;
    font-family: verdana,arial,sans-serif;
    font-size: 14px;
}
textarea {
    height: 200;
    width: 800;   
}
</style>
</head>

<script type="text/javascript">
    function saveOptions() {
        localStorage['userList'] = document.getElementById('userList').value;
        localStorage['wordList'] = document.getElementById('wordList').value;
        var delaySecs = document.getElementById('delaySecs').value;
        localStorage['delaySecs'] = isNaN(delaySecs) ? 0 : delaySecs;
        localStorage['userReplaceEnabled'] = document.getElementById('userReplaceEnabled').checked;
        localStorage['wordReplaceEnabled'] = document.getElementById('wordReplaceEnabled').checked;
        localStorage['smileysEnabled'] = document.getElementById('smileysEnabled').checked;
        localStorage['smileys'] = document.getElementById('smileys').value;
        localStorage['hideIgnoredEnabled'] = document.getElementById('hideIgnoredEnabled').checked;
        localStorage['eggsEnabled'] = document.getElementById('eggsEnabled').checked;        
        alert('Changes will kick in on the next kipin refresh.');
    }
    
    function restoreOptions() {
        document.getElementById('userList').value = getUserList();
        document.getElementById('wordList').value = getWordList();
        document.getElementById('delaySecs').value = getDelaySecs();
        document.getElementById('userReplaceEnabled').checked = getUserReplaceEnabled();
        document.getElementById('wordReplaceEnabled').checked = getWordReplaceEnabled();
        document.getElementById('smileysEnabled').checked = getSmileysEnabled();
        document.getElementById('smileys').value = getSmileys();
        document.getElementById('hideIgnoredEnabled').checked = getHideIgnoredEnabled();  
        document.getElementById('eggsEnabled').checked = getEggsEnabled();       
    }   
</script>

<body onload="restoreOptions();">
    <h3>General Options</h3>
    <input type="checkbox" id="hideIgnoredEnabled" checked=""/>
    Fully hide posts from ignored users.<br />
    <input type="checkbox" id="eggsEnabled" checked=""/>
    Fuck with me sometimes.<br />        
    <h3>New Smileys</h3>
    <input type="checkbox" id="smileysEnabled" checked=""/>
    Enabled<br />
    <textarea id="smileys"></textarea>
    <p>smiley|image URL(one per line)</p>
    <h3>Replacemens</h3>
    <input id="delaySecs" type="text" size="2" value="" />
    Delay (in seconds)<br />
    <h3>Username Replacements</h3>
    <input type="checkbox" id="userReplaceEnabled" checked=""/>
    Enabled<br />
    <textarea id="userList" style="height: 200; width: 800;"></textarea>
    <p>username|replacement(one per line)</p>
     <h3>Word Replacements</h3>
    <input type="checkbox" id="wordReplaceEnabled" checked=""/>
    Enabled<br />     
    <textarea id="wordList"></textarea>
    <p>word|replacement(one per line, supports regular expressions)</p>   
    <button onclick="saveOptions();">Save</button>
</body>
</html>
